cargo.git
10 years agodocs: fix shared library compilation error
Alfie John [Mon, 13 Apr 2015 12:36:32 +0000 (22:36 +1000)]
docs: fix shared library compilation error

Currently getting:

note: /usr/bin/ld: /home/alfie/tmp/test/target/debug/build/test-39af07f97c17512a/out/libhello.a(hello.o):
relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

10 years agoAuto merge of #1501 - alexcrichton:issue-1496, r=huonw
bors [Fri, 10 Apr 2015 17:40:21 +0000 (17:40 +0000)]
Auto merge of #1501 - alexcrichton:issue-1496, r=huonw

This commit fixes two problems in Cargo:

1. Only libraries targets that produce an rlib can be doc tested
2. Only the rlib output can be doc tested

The rationale for this is listed in listed in the comments of the commit.

Closes #1496

10 years agoOnly doctest rlibs
Alex Crichton [Thu, 9 Apr 2015 17:43:49 +0000 (10:43 -0700)]
Only doctest rlibs

This commit fixes two problems in Cargo:

1. Only libraries targets that produce an rlib can be doc tested
2. Only the rlib output can be doc tested

The rationale for this is listed in listed in the comments of the commit.

Closes #1496

10 years agoAuto merge of #1499 - alexcrichton:issue-1497, r=brson
bors [Wed, 8 Apr 2015 21:50:03 +0000 (21:50 +0000)]
Auto merge of #1499 - alexcrichton:issue-1497, r=brson

That usage didn't match any docopt patterns so one just needed to be added.

Closes #1497

10 years agoAuto merge of #1498 - hugoduncan:add-cargo-home-to-config-doc, r=steveklabnik
bors [Wed, 8 Apr 2015 18:34:37 +0000 (18:34 +0000)]
Auto merge of #1498 - hugoduncan:add-cargo-home-to-config-doc, r=steveklabnik

Adds CARGO_HOME to the config documentation.

10 years agoFix `cargo search -h`
Alex Crichton [Wed, 8 Apr 2015 18:33:15 +0000 (11:33 -0700)]
Fix `cargo search -h`

That usage didn't match any docopt patterns so one just needed to be added.

Closes #1497

10 years agoDocument the CARGO_HOME env var
Hugo Duncan [Wed, 8 Apr 2015 18:32:29 +0000 (14:32 -0400)]
Document the CARGO_HOME env var

Adds CARGO_HOME to the config documentation.

10 years agoAuto merge of #1493 - alexcrichton:update-semver, r=alexcrichton
bors [Wed, 8 Apr 2015 05:18:33 +0000 (05:18 +0000)]
Auto merge of #1493 - alexcrichton:update-semver, r=alexcrichton

10 years agoUpdate semver to support multiple version reqs
Alex Crichton [Wed, 8 Apr 2015 05:16:37 +0000 (22:16 -0700)]
Update semver to support multiple version reqs

10 years agoAuto merge of #1492 - alexcrichton:issue-1491, r=huonw
bors [Wed, 8 Apr 2015 00:29:10 +0000 (00:29 +0000)]
Auto merge of #1492 - alexcrichton:issue-1491, r=huonw

Closes #1491

10 years agoDon't run doc tests if there's a filter
Alex Crichton [Tue, 7 Apr 2015 23:56:45 +0000 (16:56 -0700)]
Don't run doc tests if there's a filter

10 years agoAuto merge of #1477 - alexcrichton:issue-1474, r=huonw
bors [Tue, 7 Apr 2015 07:45:42 +0000 (07:45 +0000)]
Auto merge of #1477 - alexcrichton:issue-1474, r=huonw

Previously the "add immediate deps" logic bailed out too soon and didn't pick up
all dev-dependencies.

Closes #1474

11 years agoAuto merge of #1486 - IvanUkhov:clone, r=alexcrichton
bors [Sun, 5 Apr 2015 16:40:21 +0000 (16:40 +0000)]
Auto merge of #1486 - IvanUkhov:clone, r=alexcrichton

Hi,

This is a continuation of #1480.

Regards,
Ivan

11 years agoDerive Clone when deriving Copy
Ivan Ukhov [Sun, 5 Apr 2015 07:00:01 +0000 (09:00 +0200)]
Derive Clone when deriving Copy

11 years agoAuto merge of #1482 - DavidAwad:patch-1, r=alexcrichton
bors [Sun, 5 Apr 2015 06:42:51 +0000 (06:42 +0000)]
Auto merge of #1482 - DavidAwad:patch-1, r=alexcrichton

11 years agoAuto merge of #1483 - tamird:rustup, r=alexcrichton
bors [Sun, 5 Apr 2015 06:21:52 +0000 (06:21 +0000)]
Auto merge of #1483 - tamird:rustup, r=alexcrichton

Passes `make test` locally. r? @alexcrichton

11 years agoRustup 2015-04-02
Tamir Duberstein [Sat, 4 Apr 2015 23:19:03 +0000 (16:19 -0700)]
Rustup 2015-04-02

11 years agoMake `print-new-snapshot` fail on 403
Tamir Duberstein [Sat, 4 Apr 2015 23:18:47 +0000 (16:18 -0700)]
Make `print-new-snapshot` fail on 403

11 years agoUpdate index.md
David Awad [Sat, 4 Apr 2015 19:51:31 +0000 (15:51 -0400)]
Update index.md

11 years agoAuto merge of #1475 - alexcrichton:update, r=huonw
bors [Fri, 3 Apr 2015 01:13:19 +0000 (01:13 +0000)]
Auto merge of #1475 - alexcrichton:update, r=huonw

Along the way, this also removes the ability to specify `[[lib]]` targets while
getting warnings. While we're at it remove nearly all unstable features that
Cargo is depending on as well!

r? @huonw

11 years agoAuto merge of #1452 - alexcrichton:issue-1355, r=huonw
bors [Fri, 3 Apr 2015 00:35:44 +0000 (00:35 +0000)]
Auto merge of #1452 - alexcrichton:issue-1355, r=huonw

The hashes would occasionally disappear when the main package registry overwrote
a previous registry source, so this just adds logic to load hashes if they're
missing.

Closes #1355

11 years agoUpdate to rust-2015-04-02
Alex Crichton [Thu, 2 Apr 2015 18:12:21 +0000 (11:12 -0700)]
Update to rust-2015-04-02

Along the way, this also removes the ability to specify `[[lib]]` targets while
getting warnings. While we're at it remove nearly all unstable features that
Cargo is depending on as well!

11 years agoBe sure to include dev-deps for doctests with --extern
Alex Crichton [Thu, 2 Apr 2015 18:51:29 +0000 (11:51 -0700)]
Be sure to include dev-deps for doctests with --extern

Previously the "add immediate deps" logic bailed out too soon and didn't pick up
all dev-dependencies.

Closes #1474

11 years agoAuto merge of #1476 - brson:installer, r=alexcrichton
bors [Thu, 2 Apr 2015 18:35:52 +0000 (18:35 +0000)]
Auto merge of #1476 - brson:installer, r=alexcrichton

11 years agoUpgrade rust-installer
Brian Anderson [Thu, 2 Apr 2015 18:31:47 +0000 (11:31 -0700)]
Upgrade rust-installer

11 years agoAuto merge of #1455 - alexcrichton:issue-1449, r=brson
bors [Tue, 31 Mar 2015 17:07:38 +0000 (17:07 +0000)]
Auto merge of #1455 - alexcrichton:issue-1449, r=brson

Previously --extern was passed for *all* upstream dependencies, causing
conflicts if some had duplicate names. Now cargo only passes --extern for
libraries that were built including immediate dependencies. Cargo also
additionally now properly passes `-L dependency=` instead of just a plain `-L`.

Closes #1449

11 years agoFix passing --extern and -L to doc tests
Alex Crichton [Wed, 25 Mar 2015 19:46:21 +0000 (12:46 -0700)]
Fix passing --extern and -L to doc tests

Previously --extern was passed for *all* upstream dependencies, causing
conflicts if some had duplicate names. Now cargo only passes --extern for
libraries that were built including immediate dependencies. Cargo also
additionally now properly passes `-L dependency=` instead of just a plain `-L`.

Closes #1449

11 years agoAuto merge of #1470 - alexcrichton:update, r=alexcrichton
bors [Tue, 31 Mar 2015 16:31:44 +0000 (16:31 +0000)]
Auto merge of #1470 - alexcrichton:update, r=alexcrichton

11 years agoUse Entry::or_insert where possible
Alex Crichton [Mon, 30 Mar 2015 20:39:16 +0000 (13:39 -0700)]
Use Entry::or_insert where possible

11 years agoUpdate to rust 2015-03-30
Alex Crichton [Mon, 30 Mar 2015 19:30:50 +0000 (12:30 -0700)]
Update to rust 2015-03-30

11 years agoAuto merge of #1467 - alexcrichton:update-flate2, r=alexcrichton
bors [Sun, 29 Mar 2015 06:31:34 +0000 (06:31 +0000)]
Auto merge of #1467 - alexcrichton:update-flate2, r=alexcrichton

There were a few bugs in creation of gzip'd files which caused package creation
to fail in some circumstances.

Closes #1465

11 years agoHelp diagnose flaky test
Alex Crichton [Sun, 29 Mar 2015 06:30:39 +0000 (23:30 -0700)]
Help diagnose flaky test

11 years agoUpdate flate2-rs
Alex Crichton [Sun, 29 Mar 2015 06:08:20 +0000 (23:08 -0700)]
Update flate2-rs

There were a few bugs in creation of gzip'd files which caused package creation
to fail in some circumstances.

Closes #1465

11 years agoAuto merge of #1461 - brson:installer, r=alexcrichton
bors [Thu, 26 Mar 2015 23:14:47 +0000 (23:14 +0000)]
Auto merge of #1461 - brson:installer, r=alexcrichton

11 years agoUpdate rust-installer. Fixes --help and interop with NixOS
Brian Anderson [Thu, 26 Mar 2015 23:11:22 +0000 (16:11 -0700)]
Update rust-installer. Fixes --help and interop with NixOS

11 years agoAuto merge of #1405 - alexcrichton:issue-1401, r=alexcrichton
bors [Thu, 26 Mar 2015 21:42:57 +0000 (21:42 +0000)]
Auto merge of #1405 - alexcrichton:issue-1401, r=alexcrichton

This should inadvertently fix #1401

11 years agoUse new `kind=` syntax for libs throughout Cargo
Alex Crichton [Wed, 11 Mar 2015 18:41:17 +0000 (11:41 -0700)]
Use new `kind=` syntax for libs throughout Cargo

This should inadvertently fix #1401

11 years agoAuto merge of #1458 - alexcrichton:update, r=alexcrichton
bors [Thu, 26 Mar 2015 20:18:25 +0000 (20:18 +0000)]
Auto merge of #1458 - alexcrichton:update, r=alexcrichton

Down with as_slice!

11 years agoAuto merge of #1460 - apasel422:1459, r=alexcrichton
bors [Thu, 26 Mar 2015 19:29:34 +0000 (19:29 +0000)]
Auto merge of #1460 - apasel422:1459, r=alexcrichton

closes #1459

11 years agoAuto merge of #1457 - japaric:doc-target, r=alexcrichton
bors [Thu, 26 Mar 2015 19:17:20 +0000 (19:17 +0000)]
Auto merge of #1457 - japaric:doc-target, r=alexcrichton

closes #1427

r? @alexcrichton
cc @dpc

11 years agopass translated crate name to doc tests
Andrew Paseltiner [Thu, 26 Mar 2015 19:07:11 +0000 (15:07 -0400)]
pass translated crate name to doc tests

closes #1459

11 years agoUpdate to rust 2015-03-26
Alex Crichton [Thu, 26 Mar 2015 18:17:44 +0000 (11:17 -0700)]
Update to rust 2015-03-26

11 years agoadd --target flag support to cargo doc
Jorge Aparicio [Thu, 26 Mar 2015 02:06:18 +0000 (21:06 -0500)]
add --target flag support to cargo doc

closes #1427

11 years agoAuto merge of #1453 - alexcrichton:doc-assert, r=huonw
bors [Wed, 25 Mar 2015 23:31:37 +0000 (23:31 +0000)]
Auto merge of #1453 - alexcrichton:doc-assert, r=huonw

Closes #1454

11 years agoAuto merge of #1451 - alexcrichton:issue-1450, r=huonw
bors [Wed, 25 Mar 2015 23:13:49 +0000 (23:13 +0000)]
Auto merge of #1451 - alexcrichton:issue-1450, r=huonw

Examples, tests, binaries, etc, are all allowed to have hyphens (cargo does some
renaming internally).

Close #1450

11 years agoOnly disallow hyphens in lib target names
Alex Crichton [Wed, 25 Mar 2015 17:20:50 +0000 (10:20 -0700)]
Only disallow hyphens in lib target names

Examples, tests, binaries, etc, are all allowed to have hyphens (cargo does some
renaming internally).

Close #1450

11 years agoFix an erroneous assertion in `cargo doc`
Alex Crichton [Wed, 25 Mar 2015 19:51:23 +0000 (12:51 -0700)]
Fix an erroneous assertion in `cargo doc`

11 years agoLazily load hashes for registry sources
Alex Crichton [Wed, 25 Mar 2015 18:39:47 +0000 (11:39 -0700)]
Lazily load hashes for registry sources

The hashes would occasionally disappear when the main package registry overwrote
a previous registry source, so this just adds logic to load hashes if they're
missing.

Closes #1355

11 years agoAuto merge of #1443 - alexcrichton:hyphens-to-underscores, r=alexcrichton
bors [Wed, 25 Mar 2015 02:30:58 +0000 (02:30 +0000)]
Auto merge of #1443 - alexcrichton:hyphens-to-underscores, r=alexcrichton

This change allows *packages* to have hyphens in them, but they are always
translated to underscores when translated to a crate name. This means that all
crates are compiled with a `--crate-name` that has no hyphens (as well as
`--extern` directives having no hyphens).

Binaries and examples, however, are allowed to contain
hyphens in their name. The "crate name" will still have an underscore, but the
output will be in the same dasherized name.

Explicitly named targets are not allowed to have hyphens in them as well.

11 years agoNormalize hyphens to underscores in crate names
Alex Crichton [Fri, 20 Mar 2015 20:40:27 +0000 (13:40 -0700)]
Normalize hyphens to underscores in crate names

This change allows *packages* to have hyphens in them, but they are always
translated to underscores when translated to a crate name. This means that all
crates are compiled with a `--crate-name` that has no hyphens (as well as
`--extern` directives having no hyphens).

Binaries, examples, benchmarks, and tests, however, are allowed to contain
hyphens in their name. The "crate name" will still have an underscore, but the
output will be in the same dasherized name.

Explicitly named targets are not allowed to have hyphens in them as well.

11 years agoAuto merge of #1445 - alexcrichton:issue-727, r=alexcrichton
bors [Tue, 24 Mar 2015 22:15:53 +0000 (22:15 +0000)]
Auto merge of #1445 - alexcrichton:issue-727, r=alexcrichton

Closes #727

11 years agoAdd a test for tests in benchmarks
Alex Crichton [Tue, 24 Mar 2015 01:01:27 +0000 (18:01 -0700)]
Add a test for tests in benchmarks

Closes #727

11 years agoAuto merge of #1444 - alexcrichton:issue-1398, r=huonw
bors [Tue, 24 Mar 2015 17:55:17 +0000 (17:55 +0000)]
Auto merge of #1444 - alexcrichton:issue-1398, r=huonw

This commit removes the ndebug support from Cargo and also adds a new
configuration option for profiles, `debug-assertions`, which controls whether
debug assertions in the compiler are turned on or not.

Closes #1398

11 years agoRemove ndebug, add config of debug assertions
Alex Crichton [Tue, 24 Mar 2015 00:45:41 +0000 (17:45 -0700)]
Remove ndebug, add config of debug assertions

This commit removes the ndebug support from Cargo and also adds a new
configuration option for profiles, `debug-assertions`, which controls whether
debug assertions in the compiler are turned on or not.

Closes #1398

11 years agoAuto merge of #1441 - alexcrichton:issue-1323, r=bson
bors [Tue, 24 Mar 2015 00:15:20 +0000 (00:15 +0000)]
Auto merge of #1441 - alexcrichton:issue-1323, r=bson

This commit is a complete overhaul of how Cargo handles compilation profiles
internally. The external interface of Cargo is not affected by this change.

Previously each Target had a Profile embedded within it. Conceptually a Target
is an entry in the manifest (a binary, benchmark, etc) and a Profile controlled
various flags (e.g. --test, -C opt-level, etc). Each Package then contained many
profiles for each possible compilation mode. For example a Package would have
one target for testing a library, benchmarking a library, documenting a library,
etc. When it came to building these targets, Cargo would filter out the targets
listed to determine what needed to be built.

This filtering was largely done based off an "environment" represented as a
string. Each mode of compilation got a separate environment string like `"test"`
or `"bench"`. Altogether, however, this approach had a number of drawbacks:

* Examples in release mode do not currently work. This is due to how examples
  are classified and how release mode is handled (e.g. the "release" environment
  where examples are meant to be built in the "test" environment).
* It is not trivial to implement `cargo test --release` today.
* It is not trivial to implement `cargo build --bin foo` where *only* the binary
  `foo` is built. The same is true for examples.
* It is not trivial to add selective building of a number of
  binaries/examples/etc.
* Filtering the list of targets to build has some pretty hokey logic that
  involves pseudo-environments like "doc-all" vs "doc". This logic is duplicated
  in a few places and in general is quite brittle.
* The TOML parser greatly affects compilation due to the time at which profiles
  are generated, which seems somewhat backwards.
* Profiles must be overridden, but only partially, at compile time becuase only
  the top-level package's profile is applied.

In general, this system just needed an overhaul. This commit made a single
change of separating `Profile` from `Target` and then basically hit `make` until
all the tests passed again. The other large architectural changes are:

* Environment strings are now entirely gone.
* Filters are implemented in a much more robust fashion.
* Release mode is now handled much more gracefully.
* The unit of compilation in the backend is no longer (package, target) but
  rather (package, target, profile). This change had to be propagated many
  location in the `cargo_rustc` module.
* The backend does not filter targets to build *at all*. All filtering now
  happens entirely in the frontend.

I'll test issues after this change lands, but the motivation behind this is to
open the door to quickly fixing a number of outstanding issues against Cargo.
This change itself is not intended to close many bugs.

11 years agoFix tests for windows
Alex Crichton [Mon, 23 Mar 2015 23:56:29 +0000 (16:56 -0700)]
Fix tests for windows

11 years agolen() == 0 => is_empty()
Alex Crichton [Mon, 23 Mar 2015 23:22:04 +0000 (16:22 -0700)]
len() == 0 => is_empty()

11 years agoAuto merge of #1440 - tamird:rustup, r=alexcrichton
bors [Mon, 23 Mar 2015 21:05:05 +0000 (21:05 +0000)]
Auto merge of #1440 - tamird:rustup, r=alexcrichton

@alexcrichton

11 years agoMake sure test directory exists
Tamir Duberstein [Mon, 23 Mar 2015 20:53:28 +0000 (13:53 -0700)]
Make sure test directory exists

11 years agoRemove unneeded `allow`s
Tamir Duberstein [Mon, 23 Mar 2015 03:15:41 +0000 (20:15 -0700)]
Remove unneeded `allow`s

11 years agoUpdate to rust 2015-03-22
Tamir Duberstein [Sun, 22 Mar 2015 23:58:11 +0000 (16:58 -0700)]
Update to rust 2015-03-22

11 years agoFix printing `Fresh` for crates
Alex Crichton [Mon, 23 Mar 2015 18:49:56 +0000 (11:49 -0700)]
Fix printing `Fresh` for crates

11 years agoFix trying to document build scripts
Alex Crichton [Mon, 23 Mar 2015 18:33:22 +0000 (11:33 -0700)]
Fix trying to document build scripts

11 years agoFix documenting binaries with libraries
Alex Crichton [Mon, 23 Mar 2015 05:01:55 +0000 (22:01 -0700)]
Fix documenting binaries with libraries

11 years agoFix `cargo doc`
Alex Crichton [Sun, 22 Mar 2015 19:25:54 +0000 (12:25 -0700)]
Fix `cargo doc`

Both tweak how deep documentation is compiled as well as fixing up the
dependencies for a documented target.

11 years agoUpdate tests for tweaked error messages
Alex Crichton [Sat, 21 Mar 2015 03:23:53 +0000 (20:23 -0700)]
Update tests for tweaked error messages

11 years agoDon't factor bins into fingerprint calculations
Alex Crichton [Sat, 21 Mar 2015 03:23:07 +0000 (20:23 -0700)]
Don't factor bins into fingerprint calculations

The dependency is just there to get them to compile, not to actually induce
recompiles.

11 years agoFix fingerprints of build scripts that aren't compiled
Alex Crichton [Sat, 21 Mar 2015 03:08:13 +0000 (20:08 -0700)]
Fix fingerprints of build scripts that aren't compiled

11 years agoUpdate some error messages in tests
Alex Crichton [Sat, 21 Mar 2015 03:00:03 +0000 (20:00 -0700)]
Update some error messages in tests

11 years agoDon't compile build scripts if they aren't run
Alex Crichton [Sat, 21 Mar 2015 02:59:47 +0000 (19:59 -0700)]
Don't compile build scripts if they aren't run

11 years agoFix `cargo run` with no binaries
Alex Crichton [Sat, 21 Mar 2015 02:59:34 +0000 (19:59 -0700)]
Fix `cargo run` with no binaries

11 years agoUpdate error message for missing examples
Alex Crichton [Sat, 21 Mar 2015 02:33:12 +0000 (19:33 -0700)]
Update error message for missing examples

11 years agoFix test for bins/examples
Alex Crichton [Sat, 21 Mar 2015 02:31:12 +0000 (19:31 -0700)]
Fix test for bins/examples

Binaries are no longer always built when examples are built, so update the test
accordingly.

11 years agoList examples in binaries built
Alex Crichton [Sat, 21 Mar 2015 02:30:47 +0000 (19:30 -0700)]
List examples in binaries built

This is required for `cargo run` to work

11 years agoDon't fail `cargo run` with bins + examples
Alex Crichton [Sat, 21 Mar 2015 02:30:08 +0000 (19:30 -0700)]
Don't fail `cargo run` with bins + examples

If no filter is supplied, then only consider binaries as candidates, not
examples as well.

11 years agoFix a subtesting test
Alex Crichton [Sat, 21 Mar 2015 01:53:00 +0000 (18:53 -0700)]
Fix a subtesting test

Libraries are no longer built if they aren't doctested, so something else needed
to be present to trigger the library being built.

11 years agoOnly doctest libs by default
Alex Crichton [Sat, 21 Mar 2015 01:52:45 +0000 (18:52 -0700)]
Only doctest libs by default

11 years agoFix configuring lib targets with profile options
Alex Crichton [Sat, 21 Mar 2015 01:52:32 +0000 (18:52 -0700)]
Fix configuring lib targets with profile options

11 years agoFix cargo test --no-run
Alex Crichton [Sat, 21 Mar 2015 01:52:15 +0000 (18:52 -0700)]
Fix cargo test --no-run

11 years agoFix test for `--test` filtering
Alex Crichton [Sat, 21 Mar 2015 00:48:55 +0000 (17:48 -0700)]
Fix test for `--test` filtering

The flag now only applies to integration tests, not all targets with the
specified name.

11 years agoRemove an extraneous is_test condition
Alex Crichton [Sat, 21 Mar 2015 00:48:25 +0000 (17:48 -0700)]
Remove an extraneous is_test condition

If a profile's `test` flag is set to true, then it will always generate a unit
test so the `is_test` check is redundant.

11 years agoFix cargo test filtering for binaries
Alex Crichton [Sat, 21 Mar 2015 00:47:34 +0000 (17:47 -0700)]
Fix cargo test filtering for binaries

This adds a new `--bin` flag to `cargo test` to specifically say that a binary
should be tested. Additionally the dependencies are tweaked such that binaries
to not depend on themselves being available.

11 years agoOverhaul how cargo treats profiles
Alex Crichton [Thu, 19 Feb 2015 19:30:35 +0000 (11:30 -0800)]
Overhaul how cargo treats profiles

This commit is a complete overhaul of how Cargo handles compilation profiles
internally. The external interface of Cargo is not affected by this change.

Previously each Target had a Profile embedded within it. Conceptually a Target
is an entry in the manifest (a binary, benchmark, etc) and a Profile controlled
various flags (e.g. --test, -C opt-level, etc). Each Package then contained many
profiles for each possible compilation mode. For example a Package would have
one target for testing a library, benchmarking a library, documenting a library,
etc. When it came to building these targets, Cargo would filter out the targets
listed to determine what needed to be built.

This filtering was largely done based off an "environment" represented as a
string. Each mode of compilation got a separate environment string like `"test"`
or `"bench"`. Altogether, however, this approach had a number of drawbacks:

* Examples in release mode do not currently work. This is due to how examples
  are classified and how release mode is handled (e.g. the "release" environment
  where examples are meant to be built in the "test" environment).
* It is not trivial to implement `cargo test --release` today.
* It is not trivial to implement `cargo build --bin foo` where *only* the binary
  `foo` is built. The same is true for examples.
* It is not trivial to add selective building of a number of
  binaries/examples/etc.
* Filtering the list of targets to build has some pretty hokey logic that
  involves pseudo-environments like "doc-all" vs "doc". This logic is duplicated
  in a few places and in general is quite brittle.
* The TOML parser greatly affects compilation due to the time at which profiles
  are generated, which seems somewhat backwards.
* Profiles must be overridden, but only partially, at compile time becuase only
  the top-level package's profile is applied.

In general, this system just needed an overhaul. This commit made a single
change of separating `Profile` from `Target` and then basically hit `make` until
all the tests passed again. The other large architectural changes are:

* Environment strings are now entirely gone.
* Filters are implemented in a much more robust fashion.
* Release mode is now handled much more gracefully.
* The unit of compilation in the backend is no longer (package, target) but
  rather (package, target, profile). This change had to be propagated many
  location in the `cargo_rustc` module.
* The backend does not filter targets to build *at all*. All filtering now
  happens entirely in the frontend.

I'll test issues after this change lands, but the motivation behind this is to
open the door to quickly fixing a number of outstanding issues against Cargo.
This change itself is not intended to close many bugs.

11 years agoAuto merge of #1433 - alexcrichton:dylib, r=huonw
bors [Thu, 19 Mar 2015 02:16:10 +0000 (02:16 +0000)]
Auto merge of #1433 - alexcrichton:dylib, r=huonw

This may not end up being stable for 1.0, and we don't really need much
functionality from it anyway.

11 years agoRemove dependency on DynamicLibrary
Alex Crichton [Thu, 19 Mar 2015 01:47:10 +0000 (18:47 -0700)]
Remove dependency on DynamicLibrary

This may not end up being stable for 1.0, and we don't really need much
functionality from it anyway.

11 years agoAuto merge of #1431 - IvanUkhov:newlines, r=alexcrichton
bors [Wed, 18 Mar 2015 18:07:53 +0000 (18:07 +0000)]
Auto merge of #1431 - IvanUkhov:newlines, r=alexcrichton

Hi,

It seems that people generally prefer not having newlines after section headers in their `Cargo.toml`s. However, when one creates a new package via `cargo new`, a newline gets automatically inserted after `[package]`. Then a typical `Cargo.toml` ends up being some what inconsistent: there is a newline after `[package]`, and there are no newlines after other headers.

On top of that, the examples given on crates.io do not seem to be consistent: [sometimes](http://doc.crates.io/index.html) there is a newline after `[package]`, and [sometimes](http://doc.crates.io/manifest.html) there is none. The same applies to other section names.

I am wondering if there should be some style conventions in this regard.

Regards,
Ivan

11 years agoAuto merge of #1428 - alexcrichton:update, r=alexcrichton
bors [Wed, 18 Mar 2015 17:43:25 +0000 (17:43 +0000)]
Auto merge of #1428 - alexcrichton:update, r=alexcrichton

11 years agoMake the usage of newlines in Cargo.toml consistent
Ivan Ukhov [Wed, 18 Mar 2015 08:12:06 +0000 (09:12 +0100)]
Make the usage of newlines in Cargo.toml consistent

11 years agoAuto merge of #1429 - IvanUkhov:build-script, r=alexcrichton
bors [Tue, 17 Mar 2015 16:32:06 +0000 (16:32 +0000)]
Auto merge of #1429 - IvanUkhov:build-script, r=alexcrichton

11 years agoUpdate to rust master
Alex Crichton [Mon, 16 Mar 2015 13:27:58 +0000 (06:27 -0700)]
Update to rust master

11 years agoFix a typo in the description of the links manifest key
Ivan Ukhov [Tue, 17 Mar 2015 07:22:44 +0000 (08:22 +0100)]
Fix a typo in the description of the links manifest key

11 years agoAuto merge of #1425 - alexcrichton:issue-1421, r=huonw
bors [Mon, 16 Mar 2015 13:47:04 +0000 (13:47 +0000)]
Auto merge of #1425 - alexcrichton:issue-1421, r=huonw

This was accidentally broken in a recent refactoring.

Closes #1421

11 years agoRe-fix the `help` command's implementation
Alex Crichton [Mon, 16 Mar 2015 13:32:50 +0000 (06:32 -0700)]
Re-fix the `help` command's implementation

This was accidentally broken in a recent refactoring.

Closes #1421

11 years agoAuto merge of #1402 - cmr:issue-1015, r=alexcrichton
bors [Sat, 14 Mar 2015 18:01:07 +0000 (18:01 +0000)]
Auto merge of #1402 - cmr:issue-1015, r=alexcrichton

Deprecates the rustc-args metadata keyword in favor of rustc-link-lib and
rustc-link-search, which are more precise and allows for easy, correct
handling of spaces in pathnames.

Closes #1015

11 years agoAdd rustc_private feature to tests which need it.
Corey Richardson [Tue, 10 Mar 2015 19:58:18 +0000 (15:58 -0400)]
Add rustc_private feature to tests which need it.

11 years agoAdd dedicated metadata for adding -l/-L flags
Corey Richardson [Tue, 10 Mar 2015 17:12:47 +0000 (13:12 -0400)]
Add dedicated metadata for adding -l/-L flags

Deprecates the rustc-args metadata keyword in favor of rustc-link-lib and
rustc-link-search, which are more precise and allows for easy, correct
handling of spaces in pathnames.

Closes #1015

11 years agoAuto merge of #1412 - jakub-:rust-nightly, r=alexcrichton
bors [Thu, 12 Mar 2015 17:21:14 +0000 (17:21 +0000)]
Auto merge of #1412 - jakub-:rust-nightly, r=alexcrichton

11 years agoUpdate to the latest nightly
Jakub Bukaj [Thu, 12 Mar 2015 10:42:59 +0000 (11:42 +0100)]
Update to the latest nightly

11 years agoAuto merge of #1409 - alexcrichton:less-compiles, r=huonw
bors [Thu, 12 Mar 2015 02:41:03 +0000 (02:41 +0000)]
Auto merge of #1409 - alexcrichton:less-compiles, r=huonw

This was previously required to ensure that all relevant metadata files would
remain in place and not get deleted, but this auto-clean behavior has since been
removed so this should no longer be necessary.

11 years agoAuto merge of #1406 - alexcrichton:issue-1404, r=wycats
bors [Thu, 12 Mar 2015 02:29:59 +0000 (02:29 +0000)]
Auto merge of #1406 - alexcrichton:issue-1404, r=wycats

When loading targets to compile, be sure to use the targets from the package
that's being passed down to the compilation step, not the one that was passed in
which is overridden.

Closes #1404